package com.threefish.modules.sys.entity.monitor;

import com.threefish.common.entity.AbstractBaseEntity;
import org.nutz.dao.entity.annotation.*;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author 黄川 306955302@qq.com
 * @date: 2018/5/29
 * 描述此类：
 */
@Table("sys_mail_body")
@Comment("邮件信息表")
public class MailBody extends AbstractBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Name
    @Prev(els = @EL("$me.uuid()"))
    @ColDefine(width = 32, notNull = true)
    @Comment("主键")
    @Column("uuid")
    private String uuid;

    @Comment("业务类型-在业务中回查邮件信息")
    @Column("bizType")
    private String bizType;

    @Comment("业务编号-在业务中回查邮件信息")
    @Column("bizuuid")
    private String bizuuid;

    @Column("subject")
    @Comment("主题")
    @ColDefine(notNull = true)
    private String subject;

    @Column("htmlMsg")
    @Comment("消息内容")
    @ColDefine(type = ColType.TEXT, notNull = true)
    private String htmlMsg;

    @Comment("主送")
    @Column("toSend")
    @ColDefine(width = 2000, notNull = true)
    private String to;

    @Comment("抄送")
    @Column
    @ColDefine(width = 2000)
    private String cc;

    @Comment("密送")
    @Column
    @ColDefine(width = 2000)
    private String bcc;

    @Comment("定时发送时间-为null立即发送")
    @Column
    private Timestamp taskTime;

    @Comment("发送状态0待发 1已发 -1失败")
    @Column("status")
    private int status;

    @Comment("是否可以重发")
    @Default("true")
    @Column("reSend")
    private boolean reSend;

    @Comment("重新发送次数限制-最大不超过5次")
    @ColDefine(width = 1)
    @Column("maxSendNum")
    private int maxSendNum;

    @Comment("已发送次数")
    @Default("0")
    @Column("sendNum")
    private int sendNum;

    @Column("errorMsg")
    @Comment("错误信息内容")
    @ColDefine(type = ColType.TEXT)
    private String errorMsg;

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public boolean isReSend() {
        return reSend;
    }

    public void setReSend(boolean reSend) {
        this.reSend = reSend;
    }

    public int getMaxSendNum() {
        return maxSendNum;
    }

    public void setMaxSendNum(int maxSendNum) {
        this.maxSendNum = maxSendNum > 5 ? 5 : maxSendNum;
    }

    public int getSendNum() {
        return sendNum;
    }

    public void setSendNum(int sendNum) {
        this.sendNum = sendNum;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public String getBizuuid() {
        return bizuuid;
    }

    public void setBizuuid(String bizuuid) {
        this.bizuuid = bizuuid;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getHtmlMsg() {
        return htmlMsg;
    }

    public void setHtmlMsg(String htmlMsg) {
        this.htmlMsg = htmlMsg;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getCc() {
        return cc;
    }

    public void setCc(String cc) {
        this.cc = cc;
    }

    public String getBcc() {
        return bcc;
    }

    public void setBcc(String bcc) {
        this.bcc = bcc;
    }

    public Timestamp getTaskTime() {
        return taskTime;
    }

    public void setTaskTime(Timestamp taskTime) {
        this.taskTime = taskTime;
    }
}
